#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>
#include<time.h>
typedef struct Heap
{
	int* arr;
	int size;
	int capcity;
}heap;
void Heapinit(Heap* heap);
void Swap(int* buf1, int* buf2);
void AdjustDown(int* a, int length, int parent);
void AdjustUp(int* arr,unsigned int child);
void HeapPrint(int* arr);
int HeapEmpty(heap* heap);
void HeapDesroty(heap* heap);
void HeapPop(heap* heap);
int HeapTop(heap* heap);
void HeapCreat(heap* heap,int* array,int length);
void PrintTopK(int* a, int n, int k);
void HeapSort(int* arr, int length);